<?php
/**
 * Created by PhpStorm.
 * User: 墨鱼行
 * Signature: 好好学习，天天向上
 * Date: 19-2-26
 * Time: 下午3:42
 */

namespace app\api\validate;

class AddressValidate extends BaseValidate
{
    public function __construct ($method = '')
    {
        switch ($method)
        {
            case 'edit':
                $this->rule = [
                    'name'     => 'require|isNotEmpty',
                    'mobile'   => 'require|mobile',
                    'province' => 'require|isNotEmpty|length:0,10',
                    'city'     => 'require|isNotEmpty|length:0,10',
                    'country'  => 'require|isNotEmpty|length:0,10',
                    'detail'   => 'require|isNotEmpty|length:0,100'
                ];
                $this->message = [
                    'name'     => '收件人名字不能为空',
                    'mobile'   => '手机号码格式错误',
                    'province' => '省份不能为空或过长',
                    'city'     => '城市不能为空或过长',
                    'country'  => '国家信息不能为空或过长',
                    'detail'   => '详细地址不能为空或过长',
                ];
                break;
        }

    }
}